package com.harbor.java.domain;


/**
 * @Description : 水果实体类
 * @Author : lxj
 * @CreateTime : 2025/7/15 16:36
 */
public class Fruit {
    private int id; //水果id（实际id使用数据库自增ID）

    private String name; //水果名称

    private double pricePerKg; //每kg水果的价格

    private double discount = 1.0; //水果的折扣，默认是10折

    public Fruit(int id, String name, double pricePerKg) {
        this.id = id;
        this.name = name;
        this.pricePerKg = pricePerKg;
    }

    public Fruit(int id, String name, double pricePerKg, double discount) {
        this.id = id;
        this.name = name;
        this.pricePerKg = pricePerKg;
        this.discount = discount;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPricePerKg() {
        return pricePerKg;
    }

    public void setPricePerKg(double pricePerKg) {
        this.pricePerKg = pricePerKg;
    }

    public double getDiscount() {
        return discount;
    }

    public void setDiscount(double discount) {
        this.discount = discount;
    }
}